<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">
		<title>dept_mag.jsp</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<link rel="stylesheet" type="text/css" href="./css/style.css">
		
	</head>

	<body>
		<div id="blue_button">
			&nbsp;&nbsp;员工查询
		</div>
		<div id="right_background">
			&nbsp;
			<br>
			<br>
			<form action="./emp/empSearchAction?page=1" method="post" >
				<table cellspacing="1" class="tab_dept">

					<tr class="tab_header">
						<td valign="middle" align="center">
							员工名称
						</td>
						<td valign="middle" align="center">
							联系电话
						</td>
						<td valign="middle" align="center">
							所属部门
						</td>
						<td valign="middle" align="center">
							人员类型
						</td>
					</tr>
					<tr>
						<td valign="middle" align="center">
							<input type="text" name="EName">
						</td>
						<td valign="middle" align="center">
							<input type="text" name="EPhone">
						</td>
						<td valign="middle" align="center">
							
							<select name="EDeptno"
								style="width: 150px; font-color: darkblue;">
								<option value="" ></option>
								<s:iterator value="dept" var="dept">
									<option value="<s:property value="#dept.deptno"/>" >
										<s:property value="#dept.dname" />
									</option>
								</s:iterator>

							</select>
						</td>
						<td valign="middle" align="center">
							<input type="text" name="EJob">
						</td>
					</tr>

				</table>
				<div align="center">
					<input type="submit" value="查询员工">
				</div>
				<table cellspacing="1" class="tab_dept">

					<c:forEach items="${list1}" var="emp">
						<tr class="row2" onMouseOver=this.className
							= 'row1';onMouseOut=this.className='row2';>
							<td valign="middle" align="center">
								<a href="./emp/empDetailSearchAction?id=${emp.EId}">${emp.EName}</a>
							</td>
							<td valign="middle" align="center">
								${emp.EPhone}
							</td>
							<td valign="middle" align="center">
								${emp.EDeptno}
							</td>

							<td valign="middle" align="center">
								${emp.EJob}
							</td>

						</tr>
					</c:forEach>
				</table>
			</form>

		</div>
		<p class="paging">
			<s:if test="page== 1">
			&lt;&lt; 首页 &lt; 上一页
		  </s:if>
			<s:else>
				<a href="./emp/EmpResultAction?page=1"> &lt;&lt;首页</a>
				<a href="./emp/EmpResultAction?page=${page-1}">&lt; 上一页 </a>
			</s:else>

			<strong>第${page}页/共${totalPages}页</strong>
			<s:if test="%{page == totalPages}">
			下一页 &gt;
			末页 &gt;&gt;
		</s:if>
			<s:else>
				<a href="./emp/EmpResultAction?page=${page+1}"> 下一页 &gt;</a>
				<a href="./emp/EmpResultAction?page=${totalPages}">末页 &gt;&gt;</a>
			</s:else>

		</p>
	</body>
</html>
